#include "HiranipraShared.h"

#ifndef _SHARED_MATH_POINT_H_
#define _SHARED_MATH_POINT_H_

namespace Hiranipra {
	namespace Math {

		typedef struct Point2D_t {
			union {
				float value[ 2 ];
				struct {
					float x, y;
				};
			};
			Point2D_t( float _x = 0, float _y = 0 ) : x( _x ), y( _y ) {}
		} Point2D;

		typedef struct Point3D_t {
			union {
				float value[ 3 ];
				struct {
					float x, y, z;
				};
			};
			Point3D_t( float _x = 0, float _y = 0, float _z = 0 ) : x( _x ), y( _y ), z( _z ) {}
		} Point3D;

		FORCE_INLINE float Distance( const Point2D& p1, const Point2D& p2 )
		{
			return SQRT( ( p2.x - p1.x ) * ( p2.x - p1.x ) + ( p2.y - p1.y ) * ( p2.y - p1.y ) );
		}

		FORCE_INLINE float Distance( const Point3D& p1, const Point3D& p2 )
		{
			return SQRT( ( p2.x - p1.x ) * ( p2.x - p1.x ) + ( p2.y - p1.y ) * ( p2.y - p1.y ) + ( p2.z - p1.z ) * ( p2.z - p1.z ) );
		}

	}
}

#endif // _SHARED_MATH_POINT_H_
